#!/usr/bin/env python
#  -*-coding:utf8 -*-
 
import rospy
import numpy as np
from hellobot_msgs.msg import msg_call


def Aim():
    # aiming direction
    target = np.array([1, 2, 3, 4, 5, 6])
    new = True
    return new, target


class MicroPhoneArray():
    def __init__(self):
        self.pub = rospy.Publisher('Calling', msg_call, queue_size=10)
        rate = rospy.Rate(10)

        msg = msg_call()
        while not rospy.is_shutdown():
            new, target = Aim()
            msg.newstatus = new
            msg.x = target[0]
            msg.y = target[1]
            msg.z = target[2]

            self.pub.publish(msg)
            rospy.loginfo(msg)
            rate.sleep()


if __name__ == '__main__':
    rospy.init_node('MicroPhoneArray')
    try:
        MicroPhoneArray()
    except rospy.ROSInterruptException:
        pass
    rospy.spin()
